# -*- coding: utf-8 -*-
from django.shortcuts import render_to_response, redirect
from django.http import HttpResponse
from django.contrib.auth.forms import AuthenticationForm
from glowdrop.notes.models import Note
from glowdrop import settings
from glowdrop.utils import Question
from django.core.urlresolvers import reverse

def index(request):
    """handle home page, the url argument 'page_no' is needed to judge the notes
    to represent
    """
    page_no = request.GET.get('page_no', 0)
    if request.user.is_authenticated():
        return redirect('glowdrop.member.views.my_space')
    else:
        return render_to_response('defaults/index.html', {'user': request.user})

# only for test
def inter_info(request):
    return render_to_response('defaults/info.html',
            {'info': 'you\'ve registered successfully', 
                'next_name': 'your space', 
                'next_url': reverse('glowdrop.member.views.fellows'), 
                'stay_time': 1000000})

